Optimal. Leaf size=62 \[ -\frac {g^2 x}{e^2}-\frac {(e f+d g)^2 \log (d-e x)}{2 d e^3}+\frac {(e f-d g)^2 \log (d+e x)}{2 d e^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {716, 647, 31}
\begin {gather*} -\frac {(d g+e f)^2 \log (d-e x)}{2 d e^3}+\frac {(e f-d g)^2 \log (d+e x)}{2 d e^3}-\frac {g^2 x}{e^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 647
Rule 716
Rubi steps
\begin {align*} \int \frac {(f+g x)^2}{d^2-e^2 x^2} \, dx &=\int \left (-\frac {g^2}{e^2}+\frac {e^2 f^2+d^2 g^2+2 e^2 f g x}{e^2 \left (d^2-e^2 x^2\right )}\right ) \, dx\\ &=-\frac {g^2 x}{e^2}+\frac {\int \frac {e^2 f^2+d^2 g^2+2 e^2 f g x}{d^2-e^2 x^2} \, dx}{e^2}\\ &=-\frac {g^2 x}{e^2}-\frac {(e f-d g)^2 \int \frac {1}{-d e-e^2 x} \, dx}{2 d e}+\frac {(e f+d g)^2 \int \frac {1}{d e-e^2 x} \, dx}{2 d e}\\ &=-\frac {g^2 x}{e^2}-\frac {(e f+d g)^2 \log (d-e x)}{2 d e^3}+\frac {(e f-d g)^2 \log (d+e x)}{2 d e^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 55, normalized size = 0.89 \begin {gather*} \frac {\left (e^2 f^2+d^2 g^2\right ) \tanh ^{-1}\left (\frac {e x}{d}\right )-d e g \left (g x+f \log \left (d^2-e^2 x^2\right )\right )}{d e^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 84, normalized size = 1.35
method | result | size |
norman | \(-\frac {g^{2} x}{e^{2}}+\frac {\left (d^{2} g^{2}-2 d e f g +e^{2} f^{2}\right ) \ln \left (e x +d \right )}{2 e^{3} d}-\frac {\left (d^{2} g^{2}+2 d e f g +e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{2 d \,e^{3}}\) | \(82\) |
default | \(-\frac {g^{2} x}{e^{2}}+\frac {\left (d^{2} g^{2}-2 d e f g +e^{2} f^{2}\right ) \ln \left (e x +d \right )}{2 e^{3} d}+\frac {\left (-d^{2} g^{2}-2 d e f g -e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{2 d \,e^{3}}\) | \(84\) |
risch | \(-\frac {g^{2} x}{e^{2}}-\frac {d \ln \left (e x -d \right ) g^{2}}{2 e^{3}}-\frac {\ln \left (e x -d \right ) f g}{e^{2}}-\frac {\ln \left (e x -d \right ) f^{2}}{2 e d}+\frac {d \ln \left (-e x -d \right ) g^{2}}{2 e^{3}}-\frac {\ln \left (-e x -d \right ) f g}{e^{2}}+\frac {\ln \left (-e x -d \right ) f^{2}}{2 e d}\) | \(116\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 81, normalized size = 1.31 \begin {gather*} -g^{2} x e^{\left (-2\right )} + \frac {{\left (d^{2} g^{2} - 2 \, d f g e + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e + d\right )}{2 \, d} - \frac {{\left (d^{2} g^{2} + 2 \, d f g e + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e - d\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.80, size = 87, normalized size = 1.40 \begin {gather*} -\frac {{\left (2 \, d g^{2} x e^{2} + 2 \, d f g e^{2} \log \left (x^{2} e^{2} - d^{2}\right ) - {\left (d^{2} g^{2} + f^{2} e^{2}\right )} e \log \left (\frac {x^{2} e^{2} + 2 \, d x e + d^{2}}{x^{2} e^{2} - d^{2}}\right )\right )} e^{\left (-4\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 112 vs.
\(2 (51) = 102\).
time = 0.29, size = 112, normalized size = 1.81 \begin {gather*} - \frac {g^{2} x}{e^{2}} + \frac {\left (d g - e f\right )^{2} \log {\left (x + \frac {2 d^{2} f g + \frac {d \left (d g - e f\right )^{2}}{e}}{d^{2} g^{2} + e^{2} f^{2}} \right )}}{2 d e^{3}} - \frac {\left (d g + e f\right )^{2} \log {\left (x + \frac {2 d^{2} f g - \frac {d \left (d g + e f\right )^{2}}{e}}{d^{2} g^{2} + e^{2} f^{2}} \right )}}{2 d e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.92, size = 81, normalized size = 1.31 \begin {gather*} -g^{2} x e^{\left (-2\right )} - f g e^{\left (-2\right )} \log \left ({\left | x^{2} e^{2} - d^{2} \right |}\right ) - \frac {{\left (d^{2} g^{2} + f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (\frac {{\left | 2 \, x e^{2} - 2 \, {\left | d \right |} e \right |}}{{\left | 2 \, x e^{2} + 2 \, {\left | d \right |} e \right |}}\right )}{2 \, {\left | d \right |}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.15, size = 81, normalized size = 1.31 \begin {gather*} \frac {\ln \left (d+e\,x\right )\,\left (d^2\,g^2-2\,d\,e\,f\,g+e^2\,f^2\right )}{2\,d\,e^3}-\frac {g^2\,x}{e^2}-\frac {\ln \left (d-e\,x\right )\,\left (d^2\,g^2+2\,d\,e\,f\,g+e^2\,f^2\right )}{2\,d\,e^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________